﻿@model PagedList.IPagedList<Pageparkproject.Models.tblProject>
@using PagedList.Mvc;
@{
    ViewBag.Title = "ProjectManage";
    ViewBag.Project = "current";
    Layout = "~/Views/Shared/AdminLayoutPage.cshtml";
    <link href="~/Content/PagedList.css" rel="stylesheet" />
    <script src="~/Contents/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Contents/Admin/Script.js"></script>
    <script src="~/Contents/Admin/Theme/jconfirmaction.jquery.js"></script>
    <script src="~/Contents/Admin/ckeditor/ckeditor.js"></script>
}
<script type="text/javascript">
</script>

<div class="form">
    <a href="#" class="bt_red" onclick="closeForm();"><span class="bt_red_lft"></span><strong>Close form</strong><span class="bt_red_r"></span></a>
    <form action="/Admin/ProjectCreate" enctype="multipart/form-data" method="post" id="projectForm" >
        @Html.Hidden("PK_iProjectID","",new{@class="projectId"})
        @Html.Hidden("sAnh","",new{@class="sAnh"})
        <fieldset>
            <dl>
                <dt>
                    <label for="category">Category:</label>
                </dt>
                <dd>
                    <select size="1" name="FK_iCategoryID" id="projectCategory">
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label for="projectName">Project Name:</label></dt>
                <dd>
                    <input type="text" name="sProjectName" id="projectName" size="40" /></dd>
            </dl>
                        <dl>
                <dt>
                    <label for="dNgay">Project Date:</label></dt>
                <dd>
                    <input type="text" name="dNgay" id="dNgay" size="40" /></dd>
            </dl>
            <dl>
                <dt>
                    <label for="color">Trạng thái hiển thị</label></dt>
                <dd>
                    <input type="radio" name="bStatus" id="statusTrue" value="True" checked="checked"/><label class="check_label">Hiện</label>
                    <input type="radio" name="bStatus" id="statusFalse" value="False" /><label class="check_label">Ẩn</label>
                </dd>
            </dl>
           <dl>
                <dt>
                    <label for="upload">Ảnh đại điện:</label></dt>
                <dd>
                    <input type="file" name="file" id="images"  /></dd>
                <dd>
                    <div id="projectImage">
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label for="upload">Danh sách ảnh:</label></dt>
                <dd>
                    <input type="file" name="files" id="upload" multiple /></dd>
                <dd>
                    <div id="projectImageBox">
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>
                    <label for="projectDescription">Description:</label></dt>
                <dd>
                    <textarea name="sDescription" id="projectDescription" class="projectDescription" rows="5" cols="36"></textarea>
</dd>
            </dl>
            <dl class="submit">
                <dd><input type="submit" name="submit" id="submit" value="Submit" /></dd>
                
            </dl>
        </fieldset>

    </form>
</div>
<h2>Products Categories Settings</h2>
<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
    <thead>
        <tr>
            <th scope="col" class="rounded-company"></th>
            <th scope="col" class="rounded">Ảnh</th>
            <th scope="col" class="rounded">Tên dự án</th>
            <th scope="col" class="rounded">Mô tả</th>
            <th scope="col" class="rounded">Trạng thái</th>
            <th scope="col" class="rounded">Edit</th>
            <th scope="col" class="rounded-q4">Delete</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="6" class="rounded-foot-left">
                @Html.PagedListPager(Model, page => Url.Action("ProjectManage", new { page }))</td>
            <td class="rounded-foot-right">&nbsp;</td>
        </tr>
    </tfoot>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" name="" /></td>
                <td>
                    <img style="width:50px;height:auto;margin:0px;padding:0px;" src="~/Contents/Images/Project/@item.sAnh"/></td>
                <td>@item.sProjectName</td>
                <td>@if (item.sDescription.Count() > 20)
                    {<p>@item.sDescription.Substring(0, 19)</p> }
                    else
                    {<p>@item.sDescription</p>}</td>
                <td>@if (item.bStatus == true)
                    {<a href="@Url.Action("ProjectChangeStatus")">Hiện</a> }
                    else
                    { <a href="@Url.Action("ProjectChangeStatus")">Ẩn</a> }</td>
                <td><a href="#" onclick="projectEdit(@item.PK_iProjectID);">
                    <img src="~/Contents/Admin/Theme/images/user_edit.png" alt="" title="" border="0" /></a></td>
                <td><a href="@Url.Action("ProjectDelete", new { id = item.PK_iProjectID })" class="ask">
                    <img src="~/Contents/Admin/Theme/images/trash.png" alt="" title="" border="0" /></a></td>
            </tr>
        }
    </tbody>
</table>

<a href="#" class="bt_green" onclick="projectCreate();" ><span class="bt_green_lft"></span><strong>Add new item</strong><span class="bt_green_r"></span></a>
<a href="#" class="bt_blue"><span class="bt_blue_lft"></span><strong>View all items from category</strong><span class="bt_blue_r"></span></a>
<a href="#" class="bt_red"><span class="bt_red_lft"></span><strong>Delete items</strong><span class="bt_red_r"></span></a>

